import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LENOVO
 * Date: 2024-08-05
 * Time: 16:27
 */

public class Homework2 {
    public static int findMiss(int[] array){
        int sumTotal = 0;
        int sum = 0;
        for (int i = 0; i < array.length + 1; i++) {
            sumTotal += i;
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        return sumTotal - sum;
    }
    public static void main(String[] args) {
        int[] nums = new int[]{2,1,3,4,0,6};//0到6，缺5
        int ret = findMiss(nums);
        System.out.println(ret);
    }
}
